const mongoose = require("mongoose");
// 得到Schema
const Schema = mongoose.Schema;
// 创建对象得属性
const managerUser = new Schema({
  email: {
    type: String,
    required: true,
    unique: true,
  },
  phone: {
    type: Number,
    required: true,
    unique: true,
  },
  avatar: {
    //用户头像
    type: Schema.Types.Mixed,
  },
  userName: {
    type: String,
    required: true,
    unique: true,
  },
  password: {
    type: String,
    required: true,
  },
  roleName: {
    required: true,
    type: String
  },
  address: {
    type: [String]
  },
  detailAddress: {
    type: String
  },
  currentAuthority: {
    type: String
  },
  type: {
    type: String,
    default: "account",
  },
  registerTime: {
    type: Date,
    default: Date.now,
  },
});
module.exports = mongoose.model("managerUser", managerUser);
